package io.renren.modules.biz.dao;

import io.renren.modules.biz.entity.CountDto;
import io.renren.modules.biz.entity.MemberEntity;
import io.renren.modules.biz.entity.TeamEntity;
import io.renren.modules.biz.entity.TeamTreeDto;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.mapper.BaseMapper;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;

/**
 * 推广团队表
 * 
 * @author chenshun
 * @email sunlightcs@gmail.com
 * @date 2018-09-03 14:51:31
 */
public interface TeamDao extends BaseMapper<TeamEntity> {
	/**
	 * 分页查询伞下会员
	 * 
	 * @param rowBounds
	 * @param wrapper
	 * @return
	 */
	List<MemberEntity> selectMemberTeam(Pagination page, @Param("level") Integer level, @Param("id") Long id);

	/**
	 * 统计团队情况
	 * 
	 * @param memberId
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	CountDto countTeam(@Param("memberId") Long memberId, @Param("startDate") String startDate, @Param("endDate") String endDate);

	/**
	 * 根据ID统计当前会员的账务信息
	 * 
	 * @param memberId
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	TeamTreeDto selectAccountingByMemberId(@Param("memberId") Long memberId, @Param("startDate") String startDate, @Param("endDate") String endDate);

	/**
	 * 分页统计伞下会员的账务信息
	 * 
	 * @param page
	 * @param level
	 * @param memberId
	 * @param startDate
	 * @param endDate
	 * @return
	 */
	List<TeamTreeDto> selectAccountingByHigher(Pagination page, @Param("level") Integer level, @Param("memberId") Long memberId, @Param("startDate") String startDate,
			@Param("endDate") String endDate);
}
